package com.example.demo.com.example.strategy;

public class Order {
    private String uid;
    private String orderId;
    private double amount;

    public Order(String uid, String orderId, double amount) {
        this.uid = uid;
        this.orderId = orderId;
        this.amount = amount;
    }

    //这里选择使用什么策略进行扣款
    public PayState pay(){
        //调用策略进行付钱
        Payment payment = PayStrategy.get(PayStrategy.UNION_PAY);
        return payment.pay(uid,amount);
    }
}
